<template>
	<view>
		<view class="comp_item flex-box" v-for="(item,index) in companies" @click="companyDetail(item.id)">
			<image :src="cdnurl(item.enterpriseinfo.logo)" mode="aspectFill" class="cover"></image>
			<view class="flex-grow-1 pl25">
				<view class="m-ellipsis fwb fs32 col3 lh44">{{item.enterpriseinfo.full_name||item.enterpriseinfo.company_name}}</view>
				<view class="mt15 fs26 col9 lh38">{{item.company_scale_name||''}}</view>
				<view>
					<view class="label" v-for="benefit in item.benefits">{{benefit.name}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "company-list",
		props: {
			companies: {
				type: Array,
				default: []
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			companyDetail(id) {
				uni.navigateTo({
					url: '/pages/user/company_info?id=' + id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.comp_item{
		width: 690rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0,0,0,0.03);
		border-radius: 18rpx;
		margin-top: 20rpx;
		padding:10rpx 30rpx;
		border: 1px solid #EBEBEB;
		.cover{
			width: 183rpx;
			height: 195rpx;
		}
		.label{
			padding: 0 8rpx;
			font-size: 22rpx;
			color: #A5A5A5;
			line-height: 32rpx;
			height: 32rpx;
			display: inline-block;
			vertical-align: top;
			margin-top: 20rpx;
			margin-right: 20rpx;
			background: #ECEFF5;
			border-radius: 4rpx;
		}
	}
</style>